<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title><?php if($meta_title != ''): echo ($meta_title); ?>-<?php endif; ?>WCup后台管理</title>
<link rel="stylesheet" href="/public/Admin/dist/css/zui.css">
<link rel="stylesheet" href="/public/Admin/dist/css/zui-theme.css">
<link rel="stylesheet" href="/public/Admin/common/css/common.css">
<script type="text/javascript" src="/public/Admin/dist/lib/jquery/jquery.js"></script>
<script type="text/javascript" src="/public/Admin/dist/lib/form/jquery.form.js"></script>
<script type="text/javascript" src="/public/Admin/dist/js/zui.js"></script>
<script type="text/javascript" src="/public/Admin/dist/lib/layer/layer.js"></script>
<script type="text/javascript" src="/public/Admin/common/js/common.js"></script>

    <!-- 开关 -->
    <link rel="stylesheet" href="/public/Admin/dist/lib/switch/switch.css">
    <script type="text/javascript" src="/public/Admin/dist/lib/switch/switch.js"></script>
    <!-- 编辑器 -->
    <link rel="stylesheet" type="text/css" href="/public/Admin/dist/lib/simditor/styles/simditor.css" />
    <script type="text/javascript" src="/public/Admin/dist/lib/simditor/scripts/module.js"></script>
    <script type="text/javascript" src="/public/Admin/dist/lib/simditor/scripts/hotkeys.js"></script>
    <script type="text/javascript" src="/public/Admin/dist/lib/simditor/scripts/uploader.js"></script>
    <script type="text/javascript" src="/public/Admin/dist/lib/simditor/scripts/simditor.js"></script>
    <script type="text/javascript" src="/public/Admin/dist/lib/simditor/scripts/simditor-html.js"></script>
    <!-- 上传 -->
    <link rel="stylesheet" href="/public/Admin/dist/lib/uploader/zui.uploader.css">
    <script type="text/javascript" src="/public/Admin/dist/lib/uploader/zui.uploader.js"></script>
    <!-- 日期时间 -->
    <link rel="stylesheet" href="/public/Admin/dist/lib/datetimepicker/datetimepicker.css">
    <script type="text/javascript" src="/public/Admin/dist/lib/datetimepicker/datetimepicker.js"></script>


</head>
<body>
<div class="header">
    <nav class="navbar navbar-inverse" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse-example">
                    <span class="sr-only">切换导航</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <div class="navbar-brand" href="#">
                    <button type="button" class="slider-toggle" title="侧边栏开关">
                        <span class="sr-only">切换导航</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a href="#">WCup后台管理</a>
                </div>
            </div>
            <div class="collapse navbar-collapse navbar-collapse-example">
                <ul class="nav navbar-nav">
                    <li <?php if($mark == 'index'): ?>class="active"<?php endif; ?>><a href="<?php echo U('index/index');?>"><i class="icon icon-home"></i> 首页</a></li>
                    <li <?php if($mark == 'system'): ?>class="active"<?php endif; ?>><a href="<?php echo U('system/index');?>"><i class="icon icon-cog"></i> 系统</a></li>
                    <li <?php if($mark == 'user'): ?>class="active"<?php endif; ?>><a href="<?php echo U('user/index');?>"><i class="icon icon-user"></i> 用户</a></li>
                    <li <?php if($mark == 'content'): ?>class="active"<?php endif; ?>><a href="<?php echo U('article/index');?>"><i class="icon icon-file-text"></i> 内容</a></li>
                    <li <?php if($mark == 'extend'): ?>class="active"<?php endif; ?>><a href="<?php echo U('smsport/index');?>"><i class="icon icon-tags"></i> 扩展</a></li>
                    <li <?php if($mark == 'count'): ?>class="active"<?php endif; ?>><a href="<?php echo U('count/index');?>"><i class="icon icon-dashboard"></i> 统计</a></li>
                    <li <?php if($mark == 'module'): ?>class="dropdown active"<?php else: ?>class="dropdown"<?php endif; ?>>
                        <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown"><i class="icon icon-cube-alt"></i> 模块 <b class="caret"></b></a>
                        <ul class="dropdown-menu" role="menu">
                            <li <?php if($umark == 'company'): ?>class="active"<?php endif; ?>><a href="<?php echo U('company/index');?>">厂商</a></li>
                            <li <?php if($umark == 'team'): ?>class="active"<?php endif; ?>><a href="<?php echo U('team/index');?>">团队</a></li>
                            <li class="divider"></li>
                            <li <?php if($umark == 'project'): ?>class="active"<?php endif; ?>><a href="<?php echo U('project/index');?>">项目</a></li>
                            <li <?php if($umark == 'bug'): ?>class="active"<?php endif; ?>><a href="<?php echo U('bug/index');?>">漏洞</a></li>
                        </ul>
                    </li>
                </ul>
                <ul class="nav navbar-nav navbar-right">
                    <li class="dropdown navicon">
                        <a href="<?php echo U('home/index/index');?>" title="打开前台" target="_blank"><i class="icon icon-home"></i></a>
                    </li>
                    <li class="dropdown navicon">
                        <a class="btn-removeRuntime" href="javascript:;" data-href="<?php echo U('index/removeRuntime');?>" title="清空缓存"><i class="icon icon-trash"></i></a>
                    </li>
                    <li class="dropdown navicon bell">
                        <a href="javascript:;" title="消息通知" class="dropdown-toggle" data-toggle="dropdown"><i class="icon icon-bell-alt"></i><span class="bubble">99+</span></a>
                        <ul class="dropdown-menu">
                            <li>
                                <div class="nano nscroller">
                                    <div class="content">
                                        <ul>
                                            <li><a href="#"><i class="icon icon-cloud-upload text-info"></i> 您有 1 条数据尚未备份 <span class="date">2 分钟前</span></a></li>
                                            <li><a href="#"><i class="icon icon-bug text-success"></i> 新增了 6 个漏洞待审核 <span class="date">15 分钟前</span></a></li>
                                            <li><a href="#"><i class="icon icon-user text-warning"></i> 您有 20 条用户认证未审核 <span class="date">30 分钟前</span></a></li>
                                            <li><a href="#"><i class="icon icon-yen text-danger"></i> 有 1 条提现记录尚未处理 <span class="date">1 小时前</span></a></li>
                                        </ul>
                                    </div>
                                </div>
                                <ul class="foot">
                                    <li><a href="#">查看全部消息</a></li>
                                </ul>
                            </li>
                        </ul>
                    </li>
                    <li class="dropdown user">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown"><img class="avatar" src="/public/Admin/img/avatar2.jpg" /> <span><?php echo (session('account')); ?></span> <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                            <li><a href="#">打开前台</a></li>
                            <li><a href="#">个人设置</a></li>
                            <li><a href="#">修改密码</a></li>
                            <li class="divider"></li>
                            <li><a href="#">注销</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </nav>
</div>


    <?php if($mark == 'index'): ?><div class="slider">
    <ul class="slider-menu">
        <li>
            <a href="javascript:;">
                <div class="pull-right"><i class="icon-caret-down"></i></div><i class="icon icon-home"></i> 系统首页</a>
            <ul class="sub-menu">
                <li <?php if($umark == 'info'): ?>class="active"<?php endif; ?>><a href="<?php echo U('index/info');?>">系统信息</a></li>
            </ul>
        </li>
    </ul>
</div>

    <?php elseif($mark == 'system'): ?>
      <div class="slider">
    <ul class="slider-menu">
        <li>
            <a href="javascript:;">
                <div class="pull-right"><i class="icon-caret-down"></i></div><i class="icon icon-cogs"></i> 系统设置</a>
            <ul class="sub-menu">
                <li <?php if($umark == 'basic'): ?>class="active"<?php endif; ?>><a href="<?php echo U('system/basic');?>">基本设置</a></li>
                <li <?php if($umark == 'system'): ?>class="active"<?php endif; ?>><a href="<?php echo U('system/system');?>">后台设置</a></li>
            </ul>
        </li>
        <li>
            <a href="javascript:;">
                <div class="pull-right"><i class="icon-caret-down"></i></div><i class="icon icon-cog"></i> 系统功能</a>
            <ul class="sub-menu">
                <li <?php if($umark == 'nav'): ?>class="active"<?php endif; ?>><a href="<?php echo U('nav/index');?>">导航管理</a></li>
                <li <?php if($umark == 'upload'): ?>class="active"<?php endif; ?>><a href="<?php echo U('upload/index');?>">附件管理</a></li>
                <li <?php if($umark == 'link'): ?>class="active"<?php endif; ?>><a href="<?php echo U('link/index');?>">友情链接</a></li>
            </ul>
        </li>
        <li>
            <a href="javascript:;">
                <div class="pull-right"><i class="icon-caret-down"></i></div><i class="icon icon-server"></i> 系统权限</a>
            <ul class="sub-menu">
                <li <?php if($umark == 'admin'): ?>class="active"<?php endif; ?>><a href="<?php echo U('admin/index');?>">管理员列表</a></li>
                <li><a href="#">角色列表</a></li>
            </ul>
        </li>
    </ul>
</div>

    <?php elseif($mark == 'user'): ?>
      <div class="slider">
    <ul class="slider-menu">
        <li>
            <a href="javascript:;">
                <div class="pull-right"><i class="icon-caret-down"></i></div><i class="icon icon-user"></i> 用户管理</a>
            <ul class="sub-menu">
                <li <?php if($umark == 'config'): ?>class="active"<?php endif; ?>><a href="<?php echo U('user/config');?>">用户配置</a></li>
                <li <?php if($umark == 'list'): ?>class="active"<?php endif; ?>><a href="<?php echo U('user/index');?>">用户列表</a></li>
                <li <?php if($umark == 'title'): ?>class="active"<?php endif; ?>><a href="<?php echo U('title/index');?>">称号列表</a></li>
                <li <?php if($umark == 'grade'): ?>class="active"<?php endif; ?>><a href="<?php echo U('grade/index');?>">等级列表</a></li>
            </ul>
        </li>
        <li>
            <a href="javascript:;">
                <div class="pull-right"><i class="icon-caret-down"></i></div><i class="icon icon-list-alt"></i> 用户记录</a>
            <ul class="sub-menu">
                <li <?php if($umark == 'log_score'): ?>class="active"<?php endif; ?>><a href="<?php echo U('log/score');?>">积分记录</a></li>
                <li <?php if($umark == 'log_login'): ?>class="active"<?php endif; ?>><a href="<?php echo U('log/login');?>">登录日志</a></li>
            </ul>
        </li>
        <li>
            <a href="javascript:;">
                <div class="pull-right"><i class="icon-caret-down"></i></div><i class="icon icon-yen"></i> 钱包操作</a>
            <ul class="sub-menu">
                <li <?php if($umark == 'bill'): ?>class="active"<?php endif; ?>><a href="<?php echo U('pay/bill');?>">账单列表</a></li>
                <li <?php if($umark == 'withdraw'): ?>class="active"<?php endif; ?>><a href="<?php echo U('log/withdraw');?>">提现记录</a></li>
            </ul>
        </li>
    </ul>
</div>

    <?php elseif($mark == 'content'): ?>
      <div class="slider">
    <ul class="slider-menu">
        <li>
            <a href="javascript:;">
                <div class="pull-right"><i class="icon-caret-down"></i></div><i class="icon icon-file-text"></i> 资讯管理</a>
            <ul class="sub-menu">
                <li <?php if($umark == 'article_config'): ?>class="active"<?php endif; ?>><a href="#">资讯设置</a></li>
                <li <?php if($umark == 'article_list'): ?>class="active"<?php endif; ?>><a href="<?php echo U('article/index');?>">资讯列表</a></li>
                <li <?php if($umark == 'article_submit'): ?>class="active"<?php endif; ?>><a href="<?php echo U('article/submit');?>">投稿列表</a></li>
                <li <?php if($umark == 'article_column'): ?>class="active"<?php endif; ?>><a href="<?php echo U('column/index');?>">栏目管理</a></li>
            </ul>
        </li>
        <li>
            <a href="javascript:;">
                <div class="pull-right"><i class="icon-caret-down"></i></div><i class="icon icon-comments"></i> 论坛管理</a>
            <ul class="sub-menu">
                <li <?php if($umark == 'bbs_config'): ?>class="active"<?php endif; ?>><a href="#">论坛设置</a></li>
                <li <?php if($umark == 'bbs_list'): ?>class="active"<?php endif; ?>><a href="<?php echo U('topic/index');?>">主题列表</a></li>
                <li <?php if($umark == 'bbs_reply'): ?>class="active"<?php endif; ?>><a href="<?php echo U('reply/index');?>">回复列表</a></li>
                <li <?php if($umark == 'bbs_section'): ?>class="active"<?php endif; ?>><a href="<?php echo U('section/index');?>">版块列表</a></li>
            </ul>
        </li>
    </ul>
</div>

    <?php elseif($mark == 'extend'): ?>
      <div class="slider">
    <ul class="slider-menu">
        <li>
            <a href="javascript:;">
                <div class="pull-right"><i class="icon-caret-down"></i></div><i class="icon icon-tags"></i> 短信接口</a>
            <ul class="sub-menu">
                <li <?php if($umark == 'smsconfig'): ?>class="active"<?php endif; ?>><a href="<?php echo U('smsport/config');?>">短信配置</a></li>
                <li <?php if($umark == 'smstemp'): ?>class="active"<?php endif; ?>><a href="<?php echo U('smsport/index');?>">短信模板</a></li>
            </ul>
        </li>
    </ul>
</div>

    <?php elseif($mark == 'count'): ?>
        
    <?php elseif($mark == 'module'): ?>
        <div class="slider">
    <ul class="slider-menu">
        <li>
            <a href="javascript:;">
                <div class="pull-right"><i class="icon-caret-down"></i></div><i class="icon icon-cube"></i> 模块管理</a>
            <ul class="sub-menu">
                <li <?php if($umark == 'company'): ?>class="active"<?php endif; ?>><a href="<?php echo U('company/index');?>">厂商列表</a></li>
                <li <?php if($umark == 'team'): ?>class="active"<?php endif; ?>><a href="<?php echo U('team/index');?>">团队列表</a></li>
            </ul>
        </li>
        <li>
            <a href="javascript:;">
                <div class="pull-right"><i class="icon-caret-down"></i></div><i class="icon icon-tasks"></i> 项目管理</a>
            <ul class="sub-menu">
                <li <?php if($umark == 'project_type'): ?>class="active"<?php endif; ?>><a href="<?php echo U('projecttype/index');?>">项目类型</a></li>
                <li <?php if($umark == 'project'): ?>class="active"<?php endif; ?>><a href="<?php echo U('project/index');?>">项目列表</a></li>
            </ul>
        </li>
        <li>
            <a href="javascript:;">
                <div class="pull-right"><i class="icon-caret-down"></i></div><i class="icon icon-bug"></i> 漏洞管理</a>
            <ul class="sub-menu">
                <li <?php if($umark == 'bug_type'): ?>class="active"<?php endif; ?>><a href="<?php echo U('bugtype/index');?>">漏洞类型</a></li>
                <li <?php if($umark == 'bug'): ?>class="active"<?php endif; ?>><a href="<?php echo U('bug/index');?>">漏洞列表</a></li>
            </ul>
        </li>
    </ul>
</div><?php endif; ?>
    <div class="main">
        <div class="crumb">
            <div class="page-actions pull-right">
                <div class="btn-group">
                    <button type="button" class="btn btn-sm btn-back" title="返回"><i class="icon icon-reply"></i></button>
                    <button type="button" class="btn btn-sm btn-refresh" title="刷新"><i class="icon icon-refresh"></i></button>
                    <button type="button" class="btn btn-sm btn-next" title="前进"><i class="icon icon-reply icon-flip-horizontal"></i></button>
                </div>
            </div>
            <ul class="breadcrumb">
                <li><i class="icon icon-home"></i></li>
                <?php if(is_array($bread_crumb)): $i = 0; $__LIST__ = $bread_crumb;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><li><?php echo ($vo); ?></li><?php endforeach; endif; else: echo "" ;endif; ?>
            </ul>
        </div>
        <div class="container-fluid">
            <div class="panel">
                <div class="panel-heading">
                    <span style="line-height:32px"><?php echo ($meta_title); ?></span>
                </div>
                <div class="panel-body">
                  <form action="<?php echo ($post_url); ?>" method="post" id="data-form">
                      <?php if(is_array($form_items)): $i = 0; $__LIST__ = $form_items;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$item): $mod = ($i % 2 );++$i; switch($item["type"]): case "hidden": ?><input type="hidden" name="<?php echo ($item["name"]); ?>" value="<?php echo ($item["value"]); ?>"><?php break;?>
                            <?php case "text": ?><div class="form-group">
    <label <?php if($item['extra']['required']): ?>class="required"<?php endif; ?>><?php echo ($item["title"]); ?></label>
    <div>
        <input type="text" class="form-control" name="<?php echo ($item["name"]); ?>" value="<?php echo ($item["value"]); ?>" placeholder="请输入<?php echo ($item["title"]); ?>">
    </div>
    <div class="help-block"><?php echo ($item["tip"]); ?></div>
</div><?php break;?>
                            <?php case "password": ?><div class="form-group">
    <label <?php if($item['extra']['required']): ?>class="required"<?php endif; ?>><?php echo ($item["title"]); ?></label>
    <div>
        <input type="password" class="form-control" name="<?php echo ($item["name"]); ?>" value="" placeholder="请输入<?php echo ($item["title"]); ?>">
    </div>
    <div class="help-block"><?php echo ($item["tip"]); ?></div>
</div><?php break;?>
                            <?php case "radio": ?><div class="form-group">
    <label <?php if($item['extra']['required']): ?>class="required"<?php endif; ?>><?php echo ($item["title"]); ?></label>
    <div>
        <?php if(is_array($item["options"])): $i = 0; $__LIST__ = $item["options"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><label class="radio-inline">
              <input type="radio" name="<?php echo ($item["name"]); ?>" value="<?php echo ($vo["value"]); ?>" <?php if($item['value'] == $vo['value']): ?>checked<?php endif; ?>> <?php echo ($vo["title"]); ?>
            </label><?php endforeach; endif; else: echo "" ;endif; ?>
    </div>
    <div class="help-block"><?php echo ($item["tip"]); ?></div>
</div><?php break;?>
                            <?php case "switch": ?><div class="form-group">
    <label <?php if($item['extra']['required']): ?>class="required"<?php endif; ?>><?php echo ($item["title"]); ?></label>
    <div>
        <input type="hidden" name="<?php echo ($item["name"]); ?>" value="<?php echo ($item["value"]); ?>">
        <input type="checkbox" class="lcs_<?php echo ($item["name"]); ?>" <?php if($item['value'] == '1'): ?>checked<?php endif; ?>>
    </div>
    <div class="help-block"><?php echo ($item["tip"]); ?></div>
</div>
<script type="text/javascript">
    $('.lcs_<?php echo ($item["name"]); ?>').lc_switch('<?php echo ($item['options'][0]); ?>','<?php echo ($item['options'][1]); ?>');
    $('body').delegate('.lcs_<?php echo ($item["name"]); ?>', 'lcs-on', function() {
  		  $("input[name=<?php echo ($item["name"]); ?>]").val(1);
  	});
    $('body').delegate('.lcs_<?php echo ($item["name"]); ?>', 'lcs-off', function() {
    		$("input[name=<?php echo ($item["name"]); ?>]").val(0);
  	});
</script><?php break;?>
                            <?php case "checkbox": ?><div class="form-group">
    <label <?php if($item['extra']['required']): ?>class="required"<?php endif; ?>><?php echo ($item["title"]); ?></label>
    <div>
        <?php if(is_array($item["options"])): $i = 0; $__LIST__ = $item["options"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><label class="checkbox-inline">
              <input type="checkbox" name="<?php echo ($item["name"]); ?>" value="<?php echo ($vo["value"]); ?>" <?php if($item['value'] == $vo['value']): ?>checked<?php endif; ?>> <?php echo ($vo["title"]); ?>
            </label><?php endforeach; endif; else: echo "" ;endif; ?>
    </div>
    <div class="help-block"><?php echo ($item["tip"]); ?></div>
</div><?php break;?>
                            <?php case "select": ?><div class="form-group">
    <label <?php if($item['extra']['required']): ?>class="required"<?php endif; ?>><?php echo ($item["title"]); ?></label>
    <div>
        <select class="form-control" name="<?php echo ($item["name"]); ?>">
            <option value="">请选择<?php echo ($item["title"]); ?></option>
            <?php if(is_array($item["options"])): $i = 0; $__LIST__ = $item["options"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo["value"]); ?>" <?php if($item['value'] == $vo['value']): ?>selected<?php endif; ?> <?php if($vo['disabled']): ?>disabled<?php endif; ?>><?php echo ($vo["title"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
        </select>
    </div>
    <div class="help-block"><?php echo ($item["tip"]); ?></div>
</div><?php break;?>
                            <?php case "textarea": ?><div class="form-group">
    <label <?php if($item['extra']['required']): ?>class="required"<?php endif; ?>><?php echo ($item["title"]); ?></label>
    <div>
        <textarea name="<?php echo ($item["name"]); ?>" class="form-control" rows="4" placeholder="请输入<?php echo ($item["title"]); ?>"><?php echo ($item["value"]); ?></textarea>
    </div>
    <div class="help-block"><?php echo ($item["tip"]); ?></div>
</div><?php break;?>
                            <?php case "simditor": ?><div class="form-group">
    <label <?php if($item['extra']['required']): ?>class="required"<?php endif; ?>><?php echo ($item["title"]); ?></label>
    <div>
        <textarea id="editor" name="<?php echo ($item["name"]); ?>"><?php echo (stripslashes(htmlspecialchars_decode($item["value"]))); ?></textarea>
    </div>
    <div class="help-block"><?php echo ($item["tip"]); ?></div>
</div>
<script type="text/javascript">
    var toolbar = [ 'title', 'bold', 'italic', 'underline', 'strikethrough',
        'color', '|', 'ol', 'ul', 'blockquote', 'code', 'table', '|',
        'link', 'image', 'hr', '|', 'indent', 'outdent' ];
    var editor = new Simditor({
        textarea: $('textarea[name=<?php echo ($item["name"]); ?>]'),
        placeholder : '请输入<?php echo ($item["title"]); ?>',
        toolbar : toolbar,
        defaultImage: '/public/Admin/dist/lib/simditor/images/default.jpg',
        upload:{
          url : '<?php echo U("upload/simditorUpload");?>',
          params: null, //键值对,指定文件上传接口的额外参数,上传的时候随文件一起提交
          fileKey: 'filedata', //服务器端获取文件数据的参数名
          connectionCount: 3,
          leaveConfirm: '正在上传文件'
        }
    });
</script><?php break;?>
                            <?php case "picture": ?><div class="form-group">
    <label <?php if($item['extra']['required']): ?>class="required"<?php endif; ?>><?php echo ($item["title"]); ?></label>
    <div>
        <input type="hidden" name="<?php echo ($item["name"]); ?>" id="checkinput" value="<?php echo ($item["value"]); ?>">
        <button type="button" class="btn btn-success btn-checkpic" data-remote="<?php echo U('upload/getPics',array('checks'=>$item['value']));?>" data-toggle="modal" data-backdrop="static"><i class="icon icon-file-image"></i> 选取图片</button>
    </div>
    <div class="help-block"><?php echo ($item["tip"]); ?></div>
</div><?php break;?>
                            <?php case "image": ?><div class="form-group">
    <label <?php if($item['extra']['required']): ?>class="required"<?php endif; ?>><?php echo ($item["title"]); ?></label>
    <div>
        <input type="hidden" name="<?php echo ($item["name"]); ?>" id="imagebox" value="<?php echo ($item["value"]); ?>">
        <button type="button" class="btn btn-primary btn-imgUpload" data-toggle="modal" data-target="#upload-Modal"><i class="icon icon-file-image"></i> 上传图片</button>
    </div>
    <div class="help-block"><?php echo ($item["tip"]); ?></div>
    <div class="modal fade" id="upload-Modal">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button>
                    <h4 class="modal-title">单图上传</h4>
                </div>
                <div class="modal-body">

                    <div class="uploader">
                        <button type="button" class="btn btn-primary uploader-btn-browse">上传附件</button>
                        <div class="uploader-message">
                            <div class="content"></div>
                            <button type="button" class="close">×</button>
                        </div>
                        <div class="uploader-files">
                            <div class="file template">
                                <div class="file-box img-thumbnail">
                                    <div class="file-progress-bar"></div>
                                    <div class="file-size">0KB</div>
                                    <div class="file-icon"><i class="icon icon-file-image"></i></div>
                                    <div class="btn-delete-file"><i class="icon icon-remove-sign text-danger"></i></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary btn-saveImg">保存</button>
                </div>
            </div>
        </div>
    </div>
</div>
<style media="screen">
    .uploader .uploader-files {
        border: 2px dashed #e6e6e6;
        margin: 0;
        min-height: 160px;
    }
    .uploader .uploader-message{
        left: 80px;
        padding: 5px 12px;
    }
    .uploader .uploader-btn-browse {
        margin-bottom: 15px;
    }
    .uploader .uploader-files .file{
        display: inline-block;
        background: #fff;
    }
    .file-box{
      margin: 10px 5px;
      position: relative;
    }
    .file-box .btn-delete-file{
      position: absolute;
      top: -8px;
      right: -8px;
      cursor: pointer;
    }
    .file-box .btn-delete-file i{
      font-size: 20px;
    }
    .file-box .file-size{
      position: absolute;
      right: 20px;
      bottom: 20px;
      border-radius: 6px;
      text-align: center;
      padding: 0 6px;
      font-size: 11px;
      color: #fff;
      background: #000;
    }
    .file-box .file-icon{
        width: 120px;
        height: 120px;
        text-align: center;
        background: #fff;
    }
    .file-box .file-icon .file-icon-image{
        background-size: 100%;
    }
    .file-box .file-icon i{
        font-size: 30px;
        line-height: 120px;
    }
</style>
<script type="text/javascript">
    var imgArr = [],imgStr='',ids = $("input[name=<?php echo ($item["name"]); ?>]").val();
    if (ids!='') {
        $.post('<?php echo U("upload/getImginfo");?>',{ids:ids},function(data){
            var options = {
                mime_types: [{
                    title: '图片',
                    extensions: 'jpg,jpeg,gif,png'
                }], // 只允许上传图片
                autoUpload: true,
                staticFiles: data,
                limitFilesCount: 1, //图片最大上传数量为1
                url: "<?php echo U('upload/imgUpload');?>", //  图片上传地址
                onFileUploaded: function(file) {
                    imgArr.push(file.remoteId);
                    imgStr = imgArr.join(",");
                    $(".btn-saveImg").click(function(){
                        $("input[name=<?php echo ($item["name"]); ?>]").val(imgStr);
                        $('#upload-Modal').modal('hide')
                    });
                },
                deleteActionOnDone:function(file,doRemoveFile){

                }
            };
            $('.uploader').uploader(options);
        });
    }else {
        var options = {
            mime_types: [{
                title: '图片',
                extensions: 'jpg,jpeg,gif,png'
            }], // 只允许上传图片
            autoUpload: true,
            limitFilesCount: 1, //图片最大上传数量为1
            removeUploaded: true,
            url: "<?php echo U('upload/imgUpload');?>", //  图片上传地址
            onFileUploaded: function(file) {
                imgArr.push(file.remoteId);
                imgStr = imgArr.join(",");
                $(".btn-saveImg").click(function(){
                    $("input[name=<?php echo ($item["name"]); ?>]").val(imgStr);
                    $('#upload-Modal').modal('hide')
                });
            },
            deleteActionOnDone:function(file,doRemoveFile){

            }
        };
        $('.uploader').uploader(options);
    }
</script><?php break;?>
                            <?php case "teamavatar": ?><div class="form-group">
    <label <?php if($item['extra']['required']): ?>class="required"<?php endif; ?>><?php echo ($item["title"]); ?></label>
    <div>
      <div class="teamavatar-box">
          <input type="hidden" name="<?php echo ($item["name"]); ?>" <?php if($item['value'] == ''): ?>value="1"<?php else: ?>value="<?php echo ($item["value"]); ?>"<?php endif; ?>>
          <?php $__FOR_START_1022__=1;$__FOR_END_1022__=43;for($i=$__FOR_START_1022__;$i < $__FOR_END_1022__;$i+=1){ if($item['value'] == ''): ?><div <?php if($i == '1'): ?>class="item active"<?php else: ?>class="item"<?php endif; ?> data-id="<?php echo ($i); ?>">
                      <img src="<?php echo (getteamavatar($i)); ?>" alt="">
                  </div>
              <?php else: ?>
                  <div <?php if($i == $item['value']): ?>class="item active"<?php else: ?>class="item"<?php endif; ?> data-id="<?php echo ($i); ?>">
                      <img src="<?php echo (getteamavatar($i)); ?>" alt="">
                  </div><?php endif; } ?>
      </div>
    </div>
</div>
<style media="screen">
    .teamavatar-box{
        overflow: hidden;
        width: 450px;
    }
    .teamavatar-box .item{
        float: left;
        height: 45px;
        position: relative;
        width: 45px;
        cursor: pointer;
    }
    .teamavatar-box .item img{
      border: 3px solid #fff;
      height: 42px;
      padding: 1px;
      width: 42px;
    }
    .teamavatar-box .item.active img,.teamavatar-box .item:hover img{
      border-color: #3db1fa;
    }
</style>
<script type="text/javascript">
    $(".teamavatar-box .item").click(function(){
        $(this).addClass("active").siblings().removeClass("active");
        $("input[name=<?php echo ($item["name"]); ?>]").val($(this).data("id"));
    })
</script><?php break;?>
                            <?php case "upload": ?><div class="form-group">
    <label <?php if($item['extra']['required']): ?>class="required"<?php endif; ?>><?php echo ($item["title"]); ?></label>
    <div class="uploader">
        <div class="uploader-message">
            <div class="content"></div>
            <button type="button" class="close">×</button>
        </div>
        <div class="file-list" data-drag-placeholder="请拖拽文件到此处">
        </div>
        <div class="statusBar">
            <div class="info"></div>
            <div class="btns">
                <button type="button" class="btn uploader-btn-browse">添加附件</button>
                <button type="button" class="btn btn-primary uploader-btn-start">开始上传</button>
            </div>
        </div>
    </div>
    <div class="help-block"><?php echo ($item["tip"]); ?></div>
</div>
<style media="screen">
    .uploader{
        margin-bottom: 0;
    }
    .uploader .file-list {
        min-height: 120px;
        margin: 0;
        border: 2px dashed #e6e6e6;
    }
    .uploader .statusBar{
      margin-top: 15px;
      overflow: hidden;
    }
</style>
<script type="text/javascript">
    var options = {
      mime_types: [{title:'图片', extensions:'jpg,jpeg,gif,png'}],  // 只允许上传图片
      limitFilesCount:20,
      url:"<?php echo U('upload/startUpload');?>",  //  图片上传地址
    };
    $('.uploader').uploader(options);

</script><?php break;?>
                            <?php case "datetime": ?><div class="form-group">
    <label <?php if($item['extra']['required']): ?>class="required"<?php endif; ?>><?php echo ($item["title"]); ?></label>
    <div>
        <input type="text" class="form-control" name="<?php echo ($item["name"]); ?>" value="<?php echo ($item["value"]); ?>" placeholder="请输入<?php echo ($item["title"]); ?>">
    </div>
    <div class="help-block"><?php echo ($item["tip"]); ?></div>
</div>
<script type="text/javascript">
    // 仅选择日期
    $("input[name=<?php echo ($item["name"]); ?>]").datetimepicker({
        language:  "zh-CN",
        weekStart: 1,
        todayBtn:  1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        minView: 2,
        forceParse: 0,
        format: "yyyy.mm.dd"
    });
</script><?php break; endswitch; endforeach; endif; else: echo "" ;endif; ?>
                      <?php if($hiddenSubmit): else: ?>
                        <button type="submit" class="btn btn-primary"><i class="icon icon-save"></i> 保存</button>
                        <button type="button" class="btn btn-back">取消</button><?php endif; ?>
                  </form>
                </div>
            </div>
        </div>
    </div>

    <script type="text/javascript">
        $("#data-form").ajaxForm(function(data) {
            if (data.status) {
                layer.alert(data.text, {
                    icon: 1
                }, function() {
                    location.href = data.url;
                });
            } else {
                layer.alert(data.text, {
                    icon: 2
                });
            }
        });
    </script>



</body>
</html>